<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"                  
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                xmlns:p="http://primefaces.org/ui"
                template="./default_template.xhtml">

    <ui:define name="login">
        <f:view>
            <div class="container">
                <h:form class="form-signin">
                    <h2 class="form-signin-heading"><h:outputText value="Connexion"/></h2>
                        <c:if test='${userController.error != ""}'>
                            <div class="alert alert-error">
                                <button type="button" class="close" data-dismiss="alert">&times;</button>
                                <h4>Erreur !</h4>
                                #{userController.error}
                            </div>
                        </c:if>
                        <h:inputText id="login" value="#{userController.utilisateur.login}" class="input-block-level" />
                        <p:watermark for="login" value="Login" /> 
                        <h:inputSecret id="pwd" value="#{userController.utilisateur.pwd}" class="input-block-level" />
                        <p:watermark for="pwd" value="Mot de passe" />
                        <h:commandButton class="btn btn-large btn-primary" action="#{userController.checkLogin()}" value="Connexion" />
                </h:form>
            </div>
        </f:view>
    </ui:define>
    <ui:define name="content">
        <f:view>
            <div class="alert alert-error">
                <button type="button" class="close" data-dismiss="alert">&times;</button>
                <h4>Erreur !</h4>
                Vous êtes déjà connecté !
            </div>
        </f:view>
    </ui:define>
</ui:composition>
